<script>
    // 获取时间对象
    const date = new Date(); // 不传递参数。则默认获取当前系统时间
    console.log(date.getFullYear());
    console.log(date.getMonth() + 1);
    console.log(date.getDate());
    console.log(date.getHours());
    console.log(date.getMinutes());
    console.log(date.getSeconds());
</script>